using CfgTable;
using IQIGame.Onigao.Framework;
using IQIGame.Onigao.Game;

namespace IQIGame.Onigao.GamePlay
{
    public class UIN_MallTypeTab : UIBaseNode
    {
        #region Template Generate,don't modify
        protected class UIB_UIN_MallTypeTab
        {
            #region ObjectBinding Generate
            public IQIGame.Onigao.Framework.ExText title { protected set; get; }
            public IQIGame.Onigao.Framework.ExText titleOn { protected set; get; }
            public virtual void InitBinding(ObjectBinding __binding)
            {
                __binding.TryGetVariableValue<IQIGame.Onigao.Framework.ExText>("title", out var __tbv0);
                this.title = __tbv0;
                __binding.TryGetVariableValue<IQIGame.Onigao.Framework.ExText>("titleOn", out var __tbv1);
                this.titleOn = __tbv1;
            }
            #endregion ObjectBinding Generate 
        }
        #endregion Template Generate,don't modify



        #region fields



        #endregion fields

        #region properties

        protected UIB_UIN_MallTypeTab ui { get; private set; }
        protected UIMsgDispatcher uiMsgDispatcher => this._msgDispatcher as UIMsgDispatcher;
        #endregion properties

        protected override void BeforeInit()
        {
            ui = new UIB_UIN_MallTypeTab();
            ui.InitBinding(this.csObjBind);
        }

        protected override void OnInit()
        {

        }

        protected override void OnShow()
        {

        }

        protected override void OnHide()
        {

        }

        /// <summary>
        /// 添加UGUI侦听
        /// </summary>
        protected override void AddUGUIListener()
        {

        }

        /// <summary>
        /// 添加全局侦听（MsgDispatcher）
        /// </summary>
        protected override void AddMsgListeners()
        {

        }

        protected override void OnDispose()
        {

        }

        #region methonds

        public void Show(MallOriginalType originalType, int mainType)
        {
            this.Show();

            string strTabName = APIMall.GetMallMainTypeTabName(originalType, mainType);
            this.ui.title.text = strTabName;
            this.ui.titleOn.text = strTabName;
        }

        #endregion methonds
    }
}
